/********************************************************************************
 * Copyright(c) 2020-2025 VINCENT_WY All rights reserved.
 * - Filename
 * - Author  Vincent
 * - Version V1.0.0
 * - Date    2023/09/21
 * - Brief
 * - FunctionList:
 ******************************************************************************
 * History:
 *
 *
 *
 ******************************************************************************
 */

#pragma once
#include <iostream>
#include <map>
#include <string>
#include <sys/time.h>
#include <sys/types.h>
#include <vector>
#include <memory>

struct FileInfo {
  int freq;
  int width;
  int height;
  long long int timestamp;
  std::string fileName;
  std::shared_ptr<uint8_t[]> buffer;
};

class FileReader {
public:
  FileReader(const std::string &root, bool buffer);
  ~FileReader();
  std::vector<FileInfo> getFileInfoList();

private:
  std::string _root{};
  std::map<int, FileInfo> _fileInfoMap;
  bool getFrameInfo(const std::string &root, std::string name, FileInfo &frame, bool bufferFrame);
};